"""# 导包
import unittest
import HTMLTestRunner_PY3
import app

# 设置脚本文件路径
a = app.BASE_DIR
# 加载脚本文件到测试套件
suite = unittest.TestLoader().discover('script', pattern='test_emp.py', top_level_dir=a)
# 打开用于写入报告的文件+创建执行器
with open('./report/report.html', 'wb') as f:
    runner = HTMLTestRunner_PY3.HTMLTestRunner(f, verbosity=2,
                                               title='员工管理模块测试报告',
                                               description='v1.0')
    runner.run(suite)  # 运行"""

# 导包
import unittest,app,time
import HTMLTestRunner_PY3
from script.test_emp1_params import TestEmployee
from script.test_login_params import TestLogin
# 创建测试套件
suite = unittest.TestSuite()
# 将测试用例添加到测试套件
suite.addTest(unittest.makeSuite(TestEmployee))
suite.addTest(unittest.makeSuite(TestLogin))
# 使用HTMLTestRunner_PY3运行测试套件，生成测试报告
report_name = app.BASE_DIR + f"/report/ihrm {time.strftime('%Y%m%d %H%M%S')}.html"
with open(report_name, mode='wb') as f:
    # 实例化runner
    runner = HTMLTestRunner_PY3.HTMLTestRunner(f, title='ihrm登录和员工模块参数化测试报告', description='v1.0')
    # 使用runner运行测试套件
    runner.run(suite)

print('---666---' * 100)